package com.zbl.zblproject.core.utils;

import com.zbl.zblproject.core.entity.AdminUser;
import org.apache.commons.codec.digest.DigestUtils;


/**
 * @author youlanqiang
 * @version 1.0
 * @date 2019/1/21
 */
public class PasswordUtil {

    /**
     * 是否用户密码是否正确
     * @param password
     * @param adminUser
     * @return
     */
    public static boolean isPassword(String password, AdminUser adminUser){
        String afterPassword =  DigestUtils.md5Hex(DigestUtils.md5Hex(password) + adminUser.getEcSalt());
        return adminUser.getPassword().equals(afterPassword);
    }


}
